package com.os.opencv.java.chapter13;

import org.opencv.core.Core;
import org.opencv.videoio.VideoCapture;

public class VideoProp {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        //创建videocapture对象并打开视屏文件
        VideoCapture vc = new VideoCapture();
        vc.open("pics/2023-11-29_19-50-14.mp4");
        //确认视屏是否打开成功
        if(!vc.isOpened()){
            System.out.println("unable to load video");
            return;
        }

        //获取视屏宽度和帧高度
        double width = vc.get(3);
        double height = vc.get(4);

        //释放资源
        vc.release();

        //在控制台输出帧宽度和帧高度数据
        System.out.println("帧宽度：" + width);
        System.out.println("帧高度：" + height);
    }
}
